import {createStore, Commit} from 'vuex'
export interface GlobalConfig {
    loginflag: boolean
    token: string
    reflashtoken:string
    role: number
}
const store = createStore<GlobalConfig>({
    state: {
        loginflag:false,
        token:'',
        reflashtoken:'',
        role:0
    },
    mutations:{
        changeloginflag(state, flag){
            state.loginflag = flag
        }
    },
    actions:{
        loginflag({commit}, flag) {
            commit('changeloginflag',flag)
        }
    }

})
export default store